package com.workflow.workflowproject.serviceImpl;

import com.alibaba.fastjson2.JSONObject;
import com.workflow.workflowproject.pojo.ProcessModel;
import com.workflow.workflowproject.service.ProcessModelService;
import com.workflow.workflowproject.tools.Result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;

@Service
public class ProcessModelServiceImpl implements ProcessModelService {

    @Override
    public Result saveBpmnXml(String bpmnXml, String flowInfo, String fileId, ProcessModel processModel) throws IOException {
        String json = JSONObject.toJSONString(processModel.getProcess());
        json = json.replaceAll("\"@type\":\"java.util.LinkedHashMap\",","");
        return Result.ok();
    }
}
